package com.timer.taskRule;

public class ScanRunable implements Runnable{

    private boolean flag;

    @Override
    public void run() {
        try {
            while (!flag){
                System.out.println("ScanRunable");
                Thread.sleep(3000);
            }
            System.out.println("结束了");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public void setFlag(boolean flag){
        this.flag = flag;
    }
}
